"""
随机抽样
"""

import torch


def test_sample():
    torch.manual_seed(1)

    mean = torch.rand(1, 2)
    std = torch.rand(1, 2)

    print("seed = 1  torch.normal(mean, std)")
    print(torch.normal(mean, std))
    print()

    torch.manual_seed(2)

    mean = torch.rand(1, 2)
    std = torch.rand(1, 2)

    print("seed = 2  torch.normal(mean, std)")
    print(torch.normal(mean, std))
    print()

    torch.manual_seed(1)

    mean = torch.rand(1, 2)
    std = torch.rand(1, 2)

    print("seed = 1  torch.normal(mean, std)")
    print(torch.normal(mean, std))
    print()


if __name__ == '__main__':
    test_sample()
